const isPoneAvailable = phone => {
  var myreg = /^[1][3-9][0-9]{9}$/;
  if (!myreg.test(phone)) {
    return false;
  } else {
    return true;
  }
}
const isEmail = email => {
  var myreg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/
  if (!myreg.test(email)) {
    return false;
  } else {
    return true;
  }
}
const isIdCard = idcard => {
  var myreg = /^[1-9][0-9]{5}([1][9][0-9]{2}|[2][0][0|1][0-9])([0][1-9]|[1][0|1|2])([0][1-9]|[1|2][0-9]|[3][0|1])[0-9]{3}([0-9]|[X])$/;
  if (!myreg.test(idcard)) {
    return false;
  } else {
    return true;
  }
}

module.exports = {
  isPoneAvailable,
  isEmail,
  isIdCard
}